$(function(){
    $(".adver").mouseover(function(){
        $(".arrowLeft").show();
        $(".arrowRight").show();
    }).mouseout(function(){
        $(".arrowLeft").hide();
        $(".arrowRight").hide();
    })

    let index=1;
    //给右箭头添加点击事件
    $(".arrowRight").click(function(){
        if(index==6){
            alert("最后一张图片了")
        }else{
            index++;
        }
        $(".adver").css("background","url(images/adver0"+index+".jpg)");
        $("li:nth-of-type("+index+")").css("background","orange");
        $("li:nth-of-type("+index+")").siblings().css("background","#333333");
    })
    $(".arrowLeft").click(function(){
        if(index==1){
            alert("已经是第一张图片了")
        }else{
            index--;
        }
        $(".adver").css("background","url(images/adver0"+index+".jpg)");
        $("li:nth-of-type("+index+")").css("background","orange");
        $("li:nth-of-type("+index+")").siblings().css("background","#333333");
    })












})